package cn.lngaosu.lwyd.module.integration.dal.mysql.toutiaoaccount;

import java.util.*;

import cn.lngaosu.lwyd.framework.common.pojo.PageResult;
import cn.lngaosu.lwyd.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lngaosu.lwyd.framework.mybatis.core.mapper.BaseMapperX;
import cn.lngaosu.lwyd.module.integration.dal.dataobject.toutiaoaccount.ToutiaoAccountDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lngaosu.lwyd.module.integration.controller.admin.toutiaoaccount.vo.*;

/**
 * 今日头条账号基本信息 Mapper
 *
 * @author 张恒
 */
@Mapper
public interface ToutiaoAccountMapper extends BaseMapperX<ToutiaoAccountDO> {

    default PageResult<ToutiaoAccountDO> selectPage(ToutiaoAccountPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ToutiaoAccountDO>()
                .betweenIfPresent(ToutiaoAccountDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ToutiaoAccountDO::getDiggCount, reqVO.getDiggCount())
                .eqIfPresent(ToutiaoAccountDO::getFans, reqVO.getFans())
                .eqIfPresent(ToutiaoAccountDO::getFollowing, reqVO.getFollowing())
                .eqIfPresent(ToutiaoAccountDO::getDetailMessage, reqVO.getDetailMessage())
                .orderByDesc(ToutiaoAccountDO::getId));
    }

}